package com.swak.spi;

public class Serialization$Adaptive implements com.swak.reactivex.transport.serialize.Serialization {
	public byte getType() {
		throw new UnsupportedOperationException(
				"The method public abstract byte com.swak.reactivex.transport.serialize.Serialization.getType() of interface com.swak.reactivex.transport.serialize.Serialization is not adaptive method!");
	}

	public byte[] serialize(com.swak.registry.URL arg0, java.lang.Object arg1)
			throws com.swak.exception.SerializeException {
		if (arg0 == null)
			throw new IllegalArgumentException("url == null");
		com.swak.registry.URL url = arg0;
		String extName = url.getParameter("serialization", "kryo");
		if (extName == null)
			throw new IllegalStateException(
					"Failed to get extension (com.swak.reactivex.transport.serialize.Serialization) name from url ("
							+ url.toString() + ") use keys([serialization])");
		com.swak.reactivex.transport.serialize.Serialization extension = (com.swak.reactivex.transport.serialize.Serialization) ExtensionLoader
				.getExtensionLoader(com.swak.reactivex.transport.serialize.Serialization.class)
				.load(extName, arg0.getClass().getClassLoader());
		return extension.serialize(arg0, arg1);
	}

	@SuppressWarnings("unchecked")
	public java.lang.Object deserialize(com.swak.registry.URL arg0, byte[] arg1)
			throws com.swak.exception.SerializeException {
		if (arg0 == null)
			throw new IllegalArgumentException("url == null");
		com.swak.registry.URL url = arg0;
		String extName = url.getParameter("serialization", "kryo");
		if (extName == null)
			throw new IllegalStateException(
					"Failed to get extension (com.swak.reactivex.transport.serialize.Serialization) name from url ("
							+ url.toString() + ") use keys([serialization])");
		com.swak.reactivex.transport.serialize.Serialization extension = (com.swak.reactivex.transport.serialize.Serialization) ExtensionLoader
				.getExtensionLoader(com.swak.reactivex.transport.serialize.Serialization.class)
				.load(extName, arg0.getClass().getClassLoader());
		return extension.deserialize(arg0, arg1);
	}
}